//
// Created by TATO on 2025/7/23.
//

#ifndef HTTPSERVER_CONF_H
#define HTTPSERVER_CONF_H
#include "core.h"
#include "lstring.h"
#include "json.h"
#include "arr.h"
#include "unix/http_alloc.h"

#define CONF_FILE "./conf/tserver.json"

#define BUF_SIZE 1024
#define MAX_CLINE 512 //连接队列中的个数

typedef Leader map;

typedef struct {
    int listen;
    char* server_name;
    map *proxy_info;
} servers_t;
typedef struct {
    char *include_mime;
    char *default_mime;
    int server_num;
    servers_t *servers[];
} http_conf_t;
typedef struct {
    char *error_log;
    char *success_log;
    http_conf_t http_conf;
}global_conf_t;
typedef struct {
    char* file;
    global_conf_t gb_conf;
    json *gb_pass;
} conf_t;

int initconf(conf_t *global_conft, char* filename);
int analysisconf(conf_t *global_conft, dts context);
#endif //HTTPSERVER_CONF_H
